package structure.filter;

import java.util.List;

/**
 * 交集
 *
 * @author yeyangtao
 * @date 2020/6/23 14:47
 */
public class AndCriteria implements Criteria {
    private Criteria criteria;
    private Criteria otherCriteria;

    public AndCriteria(Criteria criteria, Criteria otherCriteria) {
        this.criteria = criteria;
        this.otherCriteria = otherCriteria;
    }

    @Override
    public List<Person> meetCriteria(List<Person> list) {
        return criteria.meetCriteria(otherCriteria.meetCriteria(list));
    }
}
